package com.andkrup.web.navigation {
	import com.andkrup.events.NavigateEvent;	
	
	/**
	 * Describes a class that can make navigational changes in a flash
	 * application. It has a collection of NavigationItems
	 * 
	 * Implementators
	 * 
	 * This could be a site-wide menu widget that controls overall navigation,
	 * but as it is possible to have more menu widgets in a site, Navigator
	 * implementators should be registered at the NavigationManager in order to
	 * share the same data
	 * 
	 * @author Andkrup
	 */
	public interface Navigator {
		function get commandpilot():INavigationManager;
		function set commandpilot(value:INavigationManager):void;
		/**
		 * Event-handler that should be invoked by the outside, when the flash-
		 * application has changed menu-navigation, and this implementation needs
		 * to update its internal state
		 */
		function onNavigationStateChange(ne:NavigateEvent):void;
		/**
		 * Must add the input menu-item parameter internally 
		 */
		function addNavigatorItem(item:NavigatorItem):void;
		/**
		 * Must completely remove the menu-item presented as input-parameter
		 */
		function removeNavigatorItem(item:NavigatorItem):void;
		/**
		 * Must check and eturn true if the Navigator implementation contains
		 * the same menu-item as the input-parameter
		 */
		function hasNavigatorItem(item:NavigatorItem):Boolean;
		/**
		 * Find and Execute a navigation item by name
		 */
		function getNavigatorItemByKey(key:String):NavigatorItem;
	}
}
